<?php
//用于扩展插件的url输出
$extendAppUrlArray = $this->frontwebsite()->frontExtendUrlArray();
$extendAppUrlPath  = $this->url('shopfront/default');
?>
<div class="uc-nav-box">
    <div class="box-hd">
        <h3 class="title"><?php echo $this->translate('用户中心'); ?></h3>
    </div>
    <div class="box-bd">
        <ul class="uc-nav-list">
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname() == 'index') echo 'class="current"'; ?>><a href="<?php echo $this->url('fronthome/default'); ?>"><?php echo $this->translate('中心首页'); ?></a></li>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Order' and $this->myviewalias()->returnActionname() != 'virtualGoods') echo 'class="current"'; ?>><a href="<?php echo $this->url('frontorder/default'); ?>"><i class="icon-th-large"></i><?php echo $this->translate('我的订单'); ?></a></li>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Order' and $this->myviewalias()->returnActionname() == 'virtualGoods') echo 'class="current"'; ?>><a href="<?php echo $this->url('frontorder/default', array('action'=>'virtualGoods')); ?>"><i class="icon-align-justify"></i><?php echo $this->translate('虚拟商品'); ?></a></li>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homefavorites') echo 'class="current"'; ?>><a href="<?php echo $this->url('frontfavorites/default'); ?>"><?php echo $this->translate('我的收藏'); ?></a></li>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homecoupon') echo 'class="current"'; ?>><a href="<?php echo $this->url('frontcoupon/default'); ?>"><?php echo $this->translate('我的优惠券'); ?></a></li>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname() == 'goodsask') echo 'class="current"'; ?>><a href="<?php echo $this->url('fronthome/default', array('action'=>'goodsask')); ?>"><?php echo $this->translate('我的咨询'); ?></a></li>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homemoney') echo 'class="current"'; ?>><a href="<?php echo $this->url('frontmoney/default'); ?>"><?php echo $this->translate('账户余额'); ?></a></li>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and in_array($this->myviewalias()->returnActionname(), array('useredit', 'userpasswd', 'qqset'))) echo 'class="current"'; ?>><a href="<?php echo $this->url('fronthome/default', array('action'=>'useredit')); ?>"><?php echo $this->translate('账户信息'); ?></a></li>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homeaddress') echo 'class="current"'; ?>><a href="<?php echo $this->url('frontaddress/default'); ?>"><?php echo $this->translate('收货地址'); ?></a></li>
            <?php
            //位于订单管理的扩展插件
            if(isset($extendAppUrlArray['userHome']) and !empty($extendAppUrlArray['userHome'])) {
                foreach($extendAppUrlArray['userHome'] as $homeKey => $homeUrlValue) { ?>
                    <li <?php if($this->myviewalias()->returnNamespace() == ucfirst($homeKey).'\Controller') echo 'class="current"'; ?>><a href="<?php echo $extendAppUrlPath . $homeUrlValue['url']; ?>"><?php echo $homeUrlValue['name']; ?></a></li>
                <?php } } ?>

            <?php
            $refundState  = $this->frontwebsite()->getOrderConfig('user_order_refund');
            if($refundState == 'true') {
            ?>
            <li <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homerefund') echo 'class="current"'; ?>><a href="<?php echo $this->url('frontrefund/default'); ?>"><?php echo $this->translate('退货申请'); ?></a></li>
            <?php } ?>
            <li><a href="<?php echo $this->url('frontuser/default',array('action'=>'loginout')); ?>"><?php echo $this->translate('用户退出'); ?></a></li>
        </ul>
    </div>
</div>